package fr.aprr.geoloc.shared.domain;

// default package
// Generated Apr 23, 2014 11:01:50 PM by Hibernate Tools 4.0.0

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * CalculTrace generated by hbm2java
 */
@Entity
@Table(name = "ody$resultat_calcul_trace", schema = "public")
public class CalculTrace implements java.io.Serializable {

	private CalculTraceId id;
	private Autoroute autoroute;
	private VehiculeFonction vehiculeFonction;

	public CalculTrace() {
	}

	public CalculTrace(CalculTraceId id) {
		this.id = id;
	}

	public CalculTrace(CalculTraceId id, Autoroute autoroute,
			VehiculeFonction vehiculeFonction) {
		this.id = id;
		this.autoroute = autoroute;
		this.vehiculeFonction = vehiculeFonction;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "idFonction", column = @Column(name = "id_fonction")),
			@AttributeOverride(name = "autoroute", column = @Column(name = "autoroute", length = 8)),
			@AttributeOverride(name = "sens", column = @Column(name = "sens", length = 8)),
			@AttributeOverride(name = "pkDebut", column = @Column(name = "pk_debut", precision = 8, scale = 8)),
			@AttributeOverride(name = "pkFin", column = @Column(name = "pk_fin", precision = 8, scale = 8)),
			@AttributeOverride(name = "couleur", column = @Column(name = "couleur")),
			@AttributeOverride(name = "niveauTrace", column = @Column(name = "niveau_trace")) })
	public CalculTraceId getId() {
		return this.id;
	}

	public void setId(CalculTraceId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "autoroute", insertable = false, updatable = false)
	public Autoroute getAutoroute() {
		return this.autoroute;
	}

	public void setAutoroute(Autoroute autoroute) {
		this.autoroute = autoroute;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_fonction", insertable = false, updatable = false)
	public VehiculeFonction getVehiculeFonction() {
		return this.vehiculeFonction;
	}

	public void setVehiculeFonction(VehiculeFonction vehiculeFonction) {
		this.vehiculeFonction = vehiculeFonction;
	}

}
